package com.hoppinzq;

import com.hoppinzq.api.DockerApi;
import com.hoppinzq.api.MusicApi;
import com.hoppinzq.service.http.HoppinHttpClient;
import com.hoppinzq.service.http.HttpApiExecutorFactory;
import java.io.IOException;
import java.net.URLEncoder;


/**
 * @author ZhangQi
 */
public class test {

    public static void main(String[] args) throws IOException {
        HoppinHttpClient hoppinHttpClient = new HoppinHttpClient
                .BuilderClient()
                .encode("GBK")
                .charset("UTF-8")
                .build();
        MusicApi musicApi = HttpApiExecutorFactory.create(MusicApi.class,hoppinHttpClient);
        String param1= URLEncoder.encode("烟花易冷","UTF-8");
        System.err.println(musicApi.queryMusic(param1));

//        HttpClient httpClient = new HttpClientConnectionHoppinRPCProvider().getHttpClient();
//        HttpGet get = new HttpGet("http://1.15.232.156:3000/search?keywords=烟花易冷");
//        HttpResponse response = httpClient.execute(get);
//        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
//            HttpEntity entity = response.getEntity();
//            String data = EntityUtils.toString(entity, "UTF-8");
//            System.err.println(data);
//        } else {
//
//        }
    }
}

